package com.info33.platform.system.controller;

import com.info33.platform.common.mvc.controller.BaseController;
import com.info33.platform.common.mvc.vo.Result;
import com.info33.platform.system.entity.SysAppMenuFast;
import com.info33.platform.system.service.SysAppMenuFastService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author admin
 */
@RestController
@RequestMapping("/SysAppMenuFast")
@Api(tags = "系统 - 管理端 app - 菜单 - 快捷")
public class SysAppMenuFastController extends BaseController<SysAppMenuFastService, SysAppMenuFast> {

    private final SysAppMenuFastService sysAppMenuFastService;

    @Autowired
    public SysAppMenuFastController(SysAppMenuFastService sysAppMenuFastService) {
        super(sysAppMenuFastService);
        this.sysAppMenuFastService = sysAppMenuFastService;
    }

    @PostMapping(value = "/app/change")
    @ApiOperation(value = "app - 更新常用菜单")
    public Result<Object> appChange(
            @RequestBody List<SysAppMenuFast> list) {
        return sysAppMenuFastService.appChange(list, getCurrentUser());
    }
}